package org.kgduyjj.toolbox.bean;

/**
 * 默认奖项构建对象
 * 
 * @author Kgduyjj
 *
 */
public class DefaultAward implements Comparable<DefaultAward> {

    protected String serialNo;// 奖品唯一标识码
    protected Double probability; // 奖品概率
    protected Integer currentQuota;// 参与计算的数量

    public DefaultAward() {
        super();
    }

    public DefaultAward(String serialNo) {
        super();
        this.serialNo = serialNo;
    }

    public DefaultAward(String serialNo, Double probability, Integer currentQuota) {
        super();
        this.serialNo = serialNo;
        this.probability = probability;
        this.currentQuota = currentQuota;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public DefaultAward setSerialNo(String serialNo) {
        this.serialNo = serialNo;
        return this;
    }

    public Double getProbability() {
        return probability;
    }

    public DefaultAward setProbability(Double probability) {
        this.probability = probability;
        return this;
    }

    public Integer getCurrentQuota() {
        return currentQuota;
    }

    public void setCurrentQuota(Integer currentQuota) {
        this.currentQuota = currentQuota;
    }

    @Override
    public int hashCode() {
        int hc = 0;
        if (serialNo == null) {
            serialNo = String.valueOf(serialNo);
        }
        hc = String.valueOf(serialNo).hashCode();
        return hc;
    }

    @Override
    public int compareTo(DefaultAward other) {
        if (null == this || null == other) {
            return 1;
        }
        return this.hashCode() == other.hashCode() ? 0 : 1;
    }

}
